$('#<%= @content.dom_id %>').replaceWith('<%= j(
  render "alchemy/essences/essence_file_editor",
    formats: [:html],
    content: @content,
    options: @options
) %>');
Alchemy.closeCurrentDialog();
Alchemy.setElementDirty($('#element_<%= @content.element.id %>'));
